home *** CD-ROM | disk | FTP | other *** search
- property ancestor, fBazooka, fBomb, fTapeLabel, fLastDeadTicks
- global kNumRooms, kRoomNames, kNumGirlsInRoom, kAlignCursNum, gNavigator, gTapes
-
- on birth me
- set ancestor to NewObj("TLayer")
- mICkrchLayer(me)
- return me
- end
-
- on mICkrchLayer me
- mIBkgnd(me)
- mIBazooka(me)
- mIBomb(me)
- mITapeLabel(me)
- mICkrch(me)
- mICkrchPreload(me)
- end
-
- on mIBkgnd me
- set aSpr to 3
- set aBkgnd to mNewView(me, "TMyView", aSpr, "bkgnd")
- set aCursL to [531, 532]
- set the cursor of sprite 3 to aCursL
- end
-
- on mIBazooka me
- set aSpr to 12
- set fBazooka to mNewView(me, "TBazooka", aSpr, "Bazooka")
- end
-
- on mIBomb me
- set aSpr to 11
- set fBomb to mNewView(me, "TAnim", aSpr, "Bomb")
- mStAnimNumBgnEnd(fBomb, the number of cast "bomb", the number of cast "bombE")
- mStLoop(fBomb, 0)
- mOffStage(fBomb)
- end
-
- on mITapeLabel me
- set aSpr to 10
- set fTapeLabel to mNewView(me, "TMyView", aSpr, "label")
- mPuppetOn(fTapeLabel)
- mOffStage(fTapeLabel)
- end
-
- on mICkrch me
- set aCurRoomName to mGtCurRoomName(gNavigator)
- set aSpr to 6
- repeat with aCkrchCount = 1 to kNumGirlsInRoom
- if not mIsDeadCkrch(gTapes, aCurRoomName, aCkrchCount) then
- set aCkrch to mNewView(me, "TCkrch", aSpr + aCkrchCount - 1, "Ckrch" & aCkrchCount)
- set aCursL to [531, 532]
- set the cursor of sprite (aSpr + aCkrchCount - 1) to aCursL
- end if
- end repeat
- updateStage()
- set fLastDeadTicks to the ticks
- end
-
- on mICkrchPreload me
- unLoadCast(the number of cast "kitchen", the number of cast "livingRoom")
- preLoadCast(the number of cast "bazooka", the number of cast "bazookaE")
- preLoadCast(the number of cast "bomb", the number of cast "bombE")
- preLoadCast(the number of cast "cockroach", the number of cast "cockroachE")
- end
-
- on mDeath me
- stpSnd(2)
- mDeath(ancestor)
- end
-
- on mReqBorn me, vCkrch
- mBorn(vCkrch)
- end
-
- on mHitCkrch me, vCkrch
- if not mCanFire(me) then
- exit
- end if
- busyCurs()
- mKill(vCkrch)
- mFireAnim(me, mGtLocV(vCkrch), "hitSnd")
- wait(45)
- mMorphAnim(me, vCkrch)
- set aCkrchNum to integer(the last char in mGtID(vCkrch))
- mHitCkrch(gTapes, mGtCurRoomName(gNavigator), aCkrchNum)
- mExamineComplete(me)
- set fLastDeadTicks to the ticks
- resetCurs()
- if the optionDown then
- set aAllDoneMessenger to NewObj("TAllDoneMessenger")
- mAddMessenger(gApp, aAllDoneMessenger)
- end if
- end
-
- on mExamineComplete me
- set aAllComplete to 1
- repeat with aRoomCount = 1 to kNumRooms
- set aRoomName to getAt(kRoomNames, aRoomCount)
- set aRoomComplete to 1
- repeat with aCkrchCount = 1 to kNumGirlsInRoom
- if not mIsDeadCkrch(gTapes, aRoomName, aCkrchCount) then
- set aRoomComplete to 0
- exit repeat
- end if
- end repeat
- if aRoomComplete = 0 then
- set aAllComplete to 0
- next repeat
- end if
- mCompleteRoom(gNavigator, aRoomName)
- end repeat
- if aAllComplete = 1 then
- set aAllDoneMessenger to NewObj("TAllDoneMessenger")
- mAddMessenger(gApp, aAllDoneMessenger)
- end if
- end
-
- on mFireBazooka me
- if not mCanFire(me) then
- exit
- end if
- busyCurs()
- mFireAnim(me, the mouseV, "hitSnd")
- puppetSound("lostSnd")
- set fLastDeadTicks to the ticks
- resetCurs()
- end
-
- on mCanFire me
- if (the ticks - fLastDeadTicks) < 15 then
- return 0
- else
- return 1
- end if
- end
-
- on mFireAnim me, vHitLocV, vHitSndName
- mOnStageAt(fBomb, mGtLocH(fBazooka), mGtLocV(fBazooka) - 100)
- puppetSound("bazookaFireSnd")
- repeat while mGtLocV(fBomb) > vHitLocV
- mStLocV(fBomb, mGtLocV(fBomb) - 10)
- mStAnimFrmNxt(fBazooka)
- updateStage()
- wait(2)
- end repeat
- mStAnimFrmFirst(fBazooka)
- puppetSound(vHitSndName)
- repeat with aBangCount = 1 to mGtNumAnimFrm(fBomb)
- mStAnimFrmNxt(fBomb)
- wait(3)
- updateStage()
- end repeat
- mOffStage(vCkrch)
- mOffStage(fBomb)
- mStAnimFrmFirst(fBomb)
- updateStage()
- end
-
- on mMorphAnim me, vCkrch
- mStLocH(vCkrch, 320)
- mStLocV(vCkrch, 240)
- mStAnimGrp(vCkrch, 2)
- mStAnimFrmFirst(vCkrch)
- puppetTransition(51)
- updateStage()
- wait(60)
- repeat with aMorphCount = 2 to mGtNumAnimFrm(vCkrch)
- mStAnimFrmNxt(vCkrch)
- wait(10)
- updateStage()
- end repeat
- set aCkrchNum to integer(the last char in mGtID(vCkrch))
- set aRoomNum to mGtCurRoomNum(gNavigator)
- mStCastNum(fTapeLabel, the number of cast (aCkrchNum & aRoomNum & "prv"))
- mOnStageAt(fTapeLabel, 320, 244)
- updateStage()
- repeat while not (the mouseDown)
- nothing()
- end repeat
- mOffStage(vCkrch)
- mOffStage(fTapeLabel)
- puppetTransition(51)
- mStAnimGrp(vCkrch, 1)
- mStAnimFrmFirst(vCkrch)
- updateStage()
- end
-